import request from "../request";

// 资源管理参数
interface resourceListParams {
	categoryId?: number;
	nameKeyword?: string;
	pageNum?: number;
	pageSize?: number;
	urlKeyword?: string;
}
interface resourceListRes {
	code: number;
	data: Data;
	message: string;
}
interface Data {
	list: resourceListItem[];
	pageNum: number;
	pageSize: number;
	total: number;
	totalPage: number;
}

interface resourceListItem {
	categoryId: number;
	createTime: string;
	description: string;
	id: number;
	name: string;
	url: string;
}
// 资源管理
export const resourceListAPI = (data?: resourceListParams): Promise<resourceListRes> => request.get("/resource/list", { params: data });
